
package bank.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


public class Customer implements Serializable{
    
    int id;
    String name;
    String forName;
    String address;
    String zipCode;
    List<BankAccount> accounts = new ArrayList<BankAccount>();
    

    public Customer(int id, String name, String forName, String address,
			String zipCode) {
		super();
		this.id = id;
		this.name = name;
		this.forName = forName;
		this.address = address;
		this.zipCode = zipCode;
	}


	public Customer() {
    }


	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public String getForName() {
		return forName;
	}


	public void setForName(String forName) {
		this.forName = forName;
	}


	public String getAddress() {
		return address;
	}


	public void setAddress(String address) {
		this.address = address;
	}


	public String getZipCode() {
		return zipCode;
	}


	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}


	public List<BankAccount> getAccounts() {
		return accounts;
	}


	public void setAccounts(List<BankAccount> accounts) {
		this.accounts = accounts;
	}
	
	
	public void addAccount(BankAccount account) {
		this.accounts.add(account);
		account.setCustomer(this);
	}
	
	public String toString(){
		return id+" "+forName+" "+name;
	}
    
}
